package Service.impl;

import Dao.Student;
import Dao.impl.StudentImpl;
import Service.Students;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;

public class StudentsImpl implements Students, InitializingBean, DisposableBean {
    private StudentImpl student;
    @Override
    public void destroy() throws Exception {
        System.out.println("销毁容器");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("开始创建");
    }

    public void setStudent(StudentImpl student) {
        this.student = student;
    }

    @Override
    public void save() {
        student.save();
        System.out.println("自动装配创建对象");
    }


}
